<?php
/**
 * @param $width
 * @param $height
 * @param $images
 * @param $unique_id
 */
function iva_front($width, $height, $images, $unique_id) {
  return "<script src=\"plugins/iva/assets/jquery.js\"></script>
          <script src=\"plugins/iva/assets/jquery.easing.1.3.js\"></script>
          <link rel=\"stylesheet\" href=\"plugins/iva/assets/global.css\">
          <script src=\"plugins/iva/assets/slides.min.jquery.js\"></script>
          <script>
            $(function(){
              $('#slides_$unique_id').slides({
                play: 3500, 
                pwidth: " . $width . ",
                pheight: " . $height . ",
                uniqueId: " . $unique_id . "
              });
            });
          </script>
          
          <div id=\"slides_$unique_id\">
            <script>
              var images = " . $images . ";
              var s = document.getElementById('slides_$unique_id');
              var sdiv = document.createElement('div');
              sdiv.className=\"slides_container_$unique_id\";
              for(var i = 0; i < images.length; i++) {
                var a = document.createElement('a');
                var img = document.createElement('img');
                img.src=images[i];
                a.appendChild(img);
                sdiv.appendChild(a);
                s.appendChild(sdiv);
              }
            </script>
          </div>";
}
?>